<template>
	<view class="box">
		<view class="content hidden">
			<view class="font_62 text_bold phone_m1">更换手机号</view>
			<input type="number" maxlength="11" placeholder="请输入新的手机号" placeholder-style="color: #ACACAC;font-weight: bold;"
			 class="phone_input bg_f1f4f4 font_27" v-model="mobile" />
			<view class="btn2" @click="get_btn">更换手机号</view>
			<view class="flex6">
				<view class="font_23 flex1">
					<view class="color_ac">点击更换，即同意</view>
					<view class="color_ff6a00" @click="get_link">《用户协议》</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				mobile: '',
			}
		},
		methods: {
			get_btn() {
				if (this.mobile.length !== 11) return getApp().get_msg('请输入正确的手机号')

				this.$http.get(this.$api.updateMobile, {
					mobile: this.mobile
				}).then(res => {
					uni.setStorageSync('isChangePhone', true);
					getApp().get_msg('修改成功');
					getApp().get_back();
				})
			},
			// 用户协议
			get_link() {
				getApp().get_navigate_url('/pages/fwb/index?type=yhxy');
			}
		}
	}
</script>

<style lang="less">
	.content {
		padding: 0 38rpx;

		.phone_m1 {
			margin: 173rpx 0 73rpx;
		}

		.phone_input {
			padding: 25rpx 38rpx;
			border-radius: 48rpx;
			margin-bottom: 104rpx;
		}

		.flex1 {
			margin: 17rpx 0;

			view {
				padding: 10rpx 0;
			}
		}
	}
</style>
